package com.example.commuity.adapter

import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.commuity.databinding.ItemRecommendSqareItemViewBinding
import com.example.commuity.entity.SquareCard


class ItemSquareCardAdapter constructor(layoutId : Int):BaseQuickAdapter<SquareCard,BaseViewHolder>(layoutId) {

    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        DataBindingUtil.bind<ItemRecommendSqareItemViewBinding>(viewHolder.itemView)
    }

    override fun convert(holder: BaseViewHolder, item: SquareCard) {

        var binding=holder.getBinding<ItemRecommendSqareItemViewBinding>()
        if (item!=null && binding!=null){
            binding.viewData=item
            binding.executePendingBindings()
        }

    }


}